﻿@model _2._16._2015_Blog.Models.BlogViewModel
@{
    ViewBag.Title = "Details";
}

<h2>Details</h2>

<p>@Model.Title</p>

<p>@Model.Text</p>

<p>Add Comment</p>
@using(Html.BeginForm())
{
    @Html.HiddenFor(m => m.NewComment.BlogPostId)
    <p>
        @Html.LabelFor(m => m.NewComment.UserName)
        @Html.TextBoxFor(m => m.NewComment.UserName)
    </p>
    <p>
        @Html.LabelFor(m => m.NewComment.Text)
        @Html.TextBoxFor(m => m.NewComment.Text)
    </p>
    <p>
        <input type="submit" value="Create Comment" />
    </p>
}

<p>Comments</p>
<ul>
@foreach(var c in Model.Comments)
{
    <li>@c.UserName - @c.Text</li>
}
</ul>